<script setup lang="ts">
const show = ref(true);
const msg = useState<string>("msg");

const t = setTimeout(() => {
  show.value = false;
  msg.value = "";
  clearTimeout(t);
}, 3000);
</script>

<template>
  <div
    class="fixed top-6 left-1/2 -translate-y-1/2 bg-gradient-to-b from-green-500 to-green-700 shadow px-2 py-1 rounded text-white text-sm z-[200]"
    v-if="show"
  >
    <slot>提示信息</slot>
  </div>
</template>
